<?php 

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @package     App_User
 * @subpackage  View
 * @author      Cheng Wei <berlios.o@gmail.com>
 * @version     $$Id: index.phtml 20 2010-12-18 09:35:07Z cheng.wei $$
 */

$this->headTitle($this->__('Home Page'));
	if(Zend_Auth::getInstance()->hasIdentity()) :
	/* @var $user User_Model_Entity_User */
		$user = Zend_Auth::getInstance()->getIdentity();
?>		
	<div class="form-side">		
		<div class="field-set profile-page">	
			<div class="form-title clearfix">
				<h2><?php echo $this->__('Home Page') ?></h2>
				<a href="<?php echo $this->baseUrl("user/pollwall/".$user->getId()); ?>"><?php echo $this->__("Preview") ?></a>
			</div>		
			<dl class="clearfix" >
				<dt>
					<label for="data-name">
						<span><?php echo $this->__("Full name")?></span>					
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getData('name') ?>
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-username">
						<span><?php echo $this->__("Username")?></span>							
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getData('username') ?>
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-country">
						<span><?php echo $this->__("Country")?></span>							
					</label>
				</dt>
				<dd class="value">	
					<?php echo $user->getSelectData('country') ?>		
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-address_information">
						<span><?php echo $this->__("Address information")?></span>
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getData('address_information') ?>				
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-zip_code">
						<span><?php echo $this->__("Zip code")?></span>							
					</label>
				</dt>
				<dd class="value">	
					<?php echo $user->getData('zip_code') ?>		
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-email">
						<span><?php echo $this->__("E-mail address")?></span>							
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getData('email') ?>
				</dd>
		   </dl>
		   <dl class="clearfix" >
				<dt>
					<label for="data-phonenumber">
						<span><?php echo $this->__("Phonenumber")?></span>
					</label>
				</dt>
				<dd class="value">	
					<?php echo $user->getData('phonenumber') ?>				
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-system_language">
						<span><?php echo $this->__("System language")?></span>
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getSelectData('system_language') ?>
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-default_poll_language">
						<span><?php echo $this->__("Default poll language")?></span>
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getSelectData('default_poll_language') ?>					
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-poll_language"><span><?php echo $this->__("Poll language")?></span></label>
				</dt>
				<dd class="value">
					<?php 
						$poll_language = array(); 
						foreach($user->getData('poll_language') as $value){ 
							array_push($poll_language,$user->getSelectData("poll_language",$value)); 
						}
					?>
					<?php echo implode(",",$poll_language) ?>
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-gender">
						<span><?php echo $this->__("Gender")?></span>
					</label>
				</dt>
				<dd class="value">	
					<?php echo $user->getSelectData("gender") ?>
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-age">
						<span><?php echo $this->__("Birthday")?></span>						
					</label>
				</dt>
				<dd class="value age" >
					<?php echo $user->getData("birthday") ?>
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-relationship">
						<span><?php echo $this->__("Relationship")?></span>
					</label>
				</dt>
				<dd class="value">	
					<?php echo $user->getSelectData('relationship') ?>	
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-education">
						<span><?php echo $this->__("Education")?></span>
					</label>
				</dt>
				<dd class="value">	
					<?php echo $user->getSelectData('education') ?>			
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-current_position">
						<span><?php echo $this->__("Current Position")?></span>
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getSelectData('current_position') ?>				
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-current_employer">
						<span><?php echo $this->__("Current Employer")?></span>
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getData('current_employer') ?>			
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-current_employer_url">
						<span><?php echo $this->__("Current Employer url")?></span>
					</label>
				</dt>
				<dd class="value">	
					<?php echo $user->getData('current_employer_url') ?>				
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-political_views">
						<span><?php echo $this->__("Political views")?></span>
					</label>
				</dt>
				<dd class="value">					
					<?php echo $user->getSelectData('political_views') ?>					
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-religious_views">
						<span><?php echo $this->__("Religious views")?></span>
					</label>
				</dt>
				<dd class="value">	
					<?php echo @$user->getSelectData('religious_views') ?>				
				</dd>
			</dl>
			<dl class="clearfix profile-picture-view">				
				<dd class="value profile-picture-edit">								
					<?php echo $user->getProfileImage() ?>
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-personal_information">
						<span><?php echo $this->__("Personal information")?></span>
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getData('personal_information') ?>			
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-web_address">
						<span><?php echo $this->__("Web-address")?></span>
					</label>
				</dt>
				<dd class="value">
					<?php echo $user->getData('web_address') ?>			
					<br />					
					<?php echo $user->getData('web_address2') ?>			
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-link">
						<span><?php echo $this->__("Link")?></span>
					</label>
				</dt>
				<dd class="value">	
					<?php echo $user->getData('link') ?>				
				</dd>
			</dl>
			<dl class="clearfix" >
				<dt>
					<label for="data-notify_by_email">
						<span><?php echo $this->__("Notify by e-mail")?></span>
					</label>
				</dt>
				<dd class="value">	
					<?php 
						$notify_by_email = array();
						foreach($user->getData("notify_by_email") as $value){
							array_push($notify_by_email,$user->getSelectData("notify_by_email",$value));
						}						
					?>				
					<?php echo str_replace("1000",$user->getData("reated_over"),implode("<br />",$notify_by_email)); ?>					
				</dd>
			</dl>	
		</div>
	</div>
<?php endif;?>
